package com.example.threadpool;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.TimeUnit;

public class MainTest1 {

    public static void main(String[] args) {
        MyThreadPoolExecutor executor = new MyThreadPoolExecutor(
                2,
                3,
                0, TimeUnit.MILLISECONDS,
                new ArrayBlockingQueue<>(10));
        executor.execute(new task1());
        executor.submit(new task1());
        executor.shutdown();
    }

}

class task1 implements Runnable {

    @Override
    public void run() {
        System.out.println("进入了task方法！！！");
        throw new RuntimeException("手动抛出异常");
    }
}
